package com.ddtech.framework.monitor.rest;

import com.ddtech.framework.monitor.vo.Server;
import io.swagger.annotations.Api;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/***
 *
 * 描述：
 * 作者： 普斌
 * 日期： 2019/12/4 16:53
 */
@Api(tags = "系统-服务信息")
@RestController
@RequestMapping("api")
public class ServiceController {

    @GetMapping(value = "/server")
    @PreAuthorize("hasAnyRole('ADMIN','SERVER_ALL')")
    public ResponseEntity getServer(){
        Server server = new Server();
        server.copyTo();
        return new ResponseEntity(server, HttpStatus.OK);
    }
}
